// import com.alibaba.druid.DbType;
// import com.alibaba.druid.sql.ast.SQLExpr;
// import com.alibaba.druid.sql.ast.SQLObject;
// import com.alibaba.druid.sql.ast.SQLStatementImpl;
// import com.alibaba.druid.sql.visitor.SQLASTVisitor;

// import java.util.ArrayList;
// import java.util.List;

#include "SQLShowCreateMaterializedViewStatement.h"
#include "../../visitor/SQLASTVisitor.h"

SQLShowCreateMaterializedViewStatement::SQLShowCreateMaterializedViewStatement()
{
}

SQLShowCreateMaterializedViewStatement::SQLShowCreateMaterializedViewStatement(DbType_ptr dbType)
    : SQLStatementImpl(dbType)
{
}

// @Override
void SQLShowCreateMaterializedViewStatement::accept0(SQLASTVisitor_ptr visitor)
{
  if (visitor->visit(SharedObject(SQLShowCreateMaterializedViewStatement)))
  {
    acceptChild(visitor, name);
  }
  visitor->endVisit(SharedObject(SQLShowCreateMaterializedViewStatement));
}

SQLExpr_ptr SQLShowCreateMaterializedViewStatement::getName()
{
  return name;
}

void SQLShowCreateMaterializedViewStatement::setName(SQLExpr_ptr x)
{
  if (x != nullptr)
  {
    x->setParent(SharedObject(SQLShowCreateMaterializedViewStatement));
  }
  this->name = x;
}

// @Override
SQLObject_list_ptr SQLShowCreateMaterializedViewStatement::getChildren()
{
  SQLObject_list_ptr children = std::make_shared<std::list<SQLObject_ptr>>();
  if (name != nullptr)
  {
    children->push_back(name);
  }
  return children;
}
